package com.zz.parkingsystem.mapper;

import com.zz.parkingsystem.dto.SectionDTO;
import com.zz.parkingsystem.entity.Section;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import com.zz.parkingsystem.vo.SectionMessageVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import com.zz.parkingsystem.vo.SectionAndParkingVo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* @author zz
* @description 针对表【t_section(路段表)】的数据库操作Mapper
* @createDate 2022-08-29 19:55:32
* @Entity com.zz.parkingsystem.entity.Section
*/
@Mapper
@Repository
public interface SectionMapper {
    List<Section> getAllsec();


    /**
     * 路段管理员页面加载时，
     * 查询所有数据路段名称，所属地区，泊位数量，未激活泊位数量，巡检员名字
     */
    List<SectionMessageVO> queryAllSectionMessage(SectionDTO sectionDTO);
    int deleteByPrimaryKey(Long id);

    int insert(Section record);


    int insertSelective(Section record);

    Section selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Section record);

    int updateByPrimaryKey(Section record);

    //查所有的街区名称，封装集合(返回给前端)
    List<Section>  selAllSection();
    //根据名字查旬该街区有多少车位空闲
    int selectByPrimarybySecname(String secname);
    //查询该街区有多少个车位已录入
    int selectByPrimarybyBusy(String secname);
    //查这个街区未录入的车位数量
    int selectByPrimarybyNotBusy(String secname);
    //把空闲的泊位显示字段(泊位号，车位状态)返回前端
    List selectByPrimarybySecnameShow(String secname);
    //把录入车的泊位显示字段(泊位号，车牌号)返回前端
    List<SectionAndParkingVo>  selectByPrimarybyBusyShow(String secname);
    //把未录入车的泊位显示字段(泊位号，车位状态)返回前端
    List<SectionAndParkingVo>   selectByPrimarybyNotBusyShow(String secname);

}
